﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using BaseEntities;
using DataAccess;
using BussinessLogic;
using System.Data;

namespace UnitTest
{
    [TestClass]
    public class UnitTestUC4
    {
        [TestMethod]
        public void TestUCViewHistory7()
        {
            ViewHistoryAccess clsViewHistoryAccess = new ViewHistoryAccess();
            ViewHistoryLogic clsViewHistoryLogic = new ViewHistoryLogic();
            string CardNo = "12345A543";
            int Ngay = 7;
            DataTable epx = clsViewHistoryAccess.ViewHistory(CardNo, Ngay);
            DataTable act = clsViewHistoryLogic.loadView(CardNo, Ngay);
            Assert.IsTrue(ViewHistoryTable.CompareDataTables(epx, act));
        }
        [TestMethod]
        public void TestUCViewHistory30()
        {
            ViewHistoryAccess clsViewHistoryAccess = new ViewHistoryAccess();
            ViewHistoryLogic clsViewHistoryLogic = new ViewHistoryLogic();
            string CardNo = "12345A543";
            int Ngay = 30;
            DataTable epx = clsViewHistoryAccess.ViewHistory(CardNo, Ngay);
            DataTable act = clsViewHistoryLogic.loadView(CardNo, Ngay);
            Assert.IsTrue(ViewHistoryTable.CompareDataTables(epx, act));
        }
        [TestMethod]
        public void TestUCViewHistory120()
        {
            ViewHistoryAccess clsViewHistoryAccess = new ViewHistoryAccess();
            ViewHistoryLogic clsViewHistoryLogic = new ViewHistoryLogic();
            string CardNo = "12345A543";
            int Ngay = 120;
            DataTable epx = clsViewHistoryAccess.ViewHistory(CardNo, Ngay);
            DataTable act = clsViewHistoryLogic.loadView(CardNo, Ngay);
            Assert.IsTrue(ViewHistoryTable.CompareDataTables(epx, act));
        }
        [TestMethod]
        public void TestUCViewHistory180()
        {
            ViewHistoryAccess clsViewHistoryAccess = new ViewHistoryAccess();
            ViewHistoryLogic clsViewHistoryLogic = new ViewHistoryLogic();
            string CardNo = "12345A543";
            int Ngay = 180;
            DataTable epx = clsViewHistoryAccess.ViewHistory(CardNo, Ngay);
            DataTable act = clsViewHistoryLogic.loadView(CardNo, Ngay);
            Assert.IsTrue(ViewHistoryTable.CompareDataTables(epx, act));
        }
        [TestMethod]
        public void TestUCViewHistory360()
        {
            ViewHistoryAccess clsViewHistoryAccess = new ViewHistoryAccess();
            ViewHistoryLogic clsViewHistoryLogic = new ViewHistoryLogic();
            string CardNo = "12345A543";
            int Ngay = 360;
            DataTable epx = clsViewHistoryAccess.ViewHistory(CardNo, Ngay);
            DataTable act = clsViewHistoryLogic.loadView(CardNo, Ngay);
            Assert.IsTrue(ViewHistoryTable.CompareDataTables(epx, act));
        }
        [TestMethod]
        public void TestUCViewHistory720()
        {
            ViewHistoryAccess clsViewHistoryAccess = new ViewHistoryAccess();
            ViewHistoryLogic clsViewHistoryLogic = new ViewHistoryLogic();
            string CardNo = "12345A543";
            int Ngay = 720;
            DataTable epx = clsViewHistoryAccess.ViewHistory(CardNo, Ngay);
            DataTable act = clsViewHistoryLogic.loadView(CardNo, Ngay);
            Assert.IsTrue(ViewHistoryTable.CompareDataTables(epx, act));
        }
    }
}
